home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13185 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why is C faster than FORTRAN?
  5. Date: 4 Apr 96 20:34:52 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.828650092@rscernix>
  8. References: <1996Mar20.132506.91237@ucl.ac.uk> <4jpabs$4pv@opal.southwind.net>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <4jpabs$4pv@opal.southwind.net> uar@southwind.net (richard mross) writes:
  13.  
  14.  
  15. >>|>My question is: what is the reason that C is so much quicker? Is C normally
  16. >>|>faster than FORTRAN?
  17. >
  18. > write a program in both languages and set the compilers on both to
  19. >output assembly code.  compare the output to see what one compiler is
  20. >doing compared to the other
  21.  
  22. Once upon a time this approach used to work.  For a modern processor,
  23. be it Pentium (Pro) or any RISC flavour, only a wizard could tell which
  24. assembly code sequence is faster simply by looking at the code.  The rest
  25. of us mere mortals are condemned to benchmarking the compiler output in
  26. order to decide which is more efficient.
  27.  
  28. If a significant amount of time is spent in library functions/procedures,
  29. looking at the assembly code is useless for _any_ processor.
  30.  
  31. Dan
  32. --
  33. Dan Pop
  34. CERN, CN Division
  35. Email: danpop@mail.cern.ch 
  36. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  37.